import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.less';
import App from './App';

import {Provider} from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import persistStore from "redux-persist/es/persistStore";
import store from './store/index'

//引入react-query
import { QueryClient, QueryClientProvider} from 'react-query'
// 创建 queryClient 对象
const queryClient = new QueryClient()



const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
        <React.StrictMode>
            <QueryClientProvider client={queryClient}>
                <Provider store={store}>
                    <PersistGate loading={null} persistor={persistStore(store)}>
                        <App />
                    </PersistGate>
                </Provider>
            </QueryClientProvider>
        </React.StrictMode>
);

